package com.itheima.reggie.common;

import com.itheima.reggie.domain.Employee;

//负责向ThreadLocal中保存 删除  查询Employee信息
public class EmployeeHolder {

    //创建ThreadLocal
    private static ThreadLocal<Employee> threadLocal = new ThreadLocal<Employee>();

    //保存
    public static void set(Employee employee) {
        threadLocal.set(employee);
    }

    //查询
    public static Employee get() {
        return threadLocal.get();
    }

    //移除
    public static void remove() {
        threadLocal.remove();
    }
}
